Repository navigation
Skip null employeeList entries in the Workspaces tab red-dot check - #103811
Conversation
…aces tab red dot Co-authored-by: Kevin Brian Bader <ikevin127@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🤖 Done. This PR is now ready for review.
You still need to fill out the QA Steps section and add screenshots or videos. Both are still empty, and the checklist now says they're done. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-10-12.at.16.51.01.mov |
|
@MelvinBot Update the PR description sections Offline tests (should say N/A) and QA Steps should say "Same as tests.". |
|
I updated the PR description:
The rest of the description is unchanged. |
|
@MelvinBot Address these inline comments:
🟡 Can we drop the // The type rules out a null entry, so set it without a cast. It goes in first so every pass over employeeList reaches it before member 1
const employeeList: PolicyEmployeeList = {};
Reflect.set(employeeList, 'stale@example.com', null);
employeeList[ownerEmail] = {email: ownerEmail, role: CONST.POLICY.ROLE.ADMIN, submitsTo: ownerEmail};
employeeList['1@example.com'] = {email: '1@example.com', role: CONST.POLICY.ROLE.USER, submitsTo: removedEmail};
const policy = buildPolicy({employeeList});
🟡 With this fix, an admin of a workspace that has a null entry can open Workflows again. But const workspaceMembers = Object.values(employeeList ?? {}).filter((employee) => !!employee?.email && employee.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE);Also, do we know where the null comes from ? Guarding each consumer only works until the next one reads Note null location from Sentry comment. |
…t the test's null entry without a cast Co-authored-by: Kevin Brian Bader <ikevin127@users.noreply.github.com>
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I made both changes in 02e7064.
Where the null comes from: I haven't confirmed it. Reading the code points to react-native-onyx 3.0.116, not to a backend
Onyx then copies the second object as-is, null entry included. After reconnect, all write responses, ReconnectApp included, are flushed in one A backend change alone wouldn't close this whole class of crash. The App also sends Evidence (from reading the code; I didn't run a repro)
|
|
The failing Analysis: Thread report drafts explicitly through the split-transaction update flow merged at 23:41 UTC on 2026-10-12. It made
Evidence: This PR only changes Next step: Add
|
|
Nothing has changed since my previous comment, so I still haven't pushed a fix. The
Next step: Someone needs to add |
|
@MelvinBot merge main into this PR |
|
I didn't merge The PR has no merge conflicts with I can only make code changes when directed by the PR author, an assignee, or an existing co-author. To have me implement this, the PR assignee or author should reply with a request tagging me. |
|
@ikevin127 - can you ask Melvin to merge main and see if that fixes the failing test? |
…eesInWorkflowBuilders Co-authored-by: Kevin Brian Bader <ikevin127@users.noreply.github.com>
|
I merged Why it was failing: The merge was clean. Compared to |
|
@tylerkaraszewski It worked, all 🟢 ready for merge! |
|
🚧 tylerkaraszewski has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@tylerkaraszewski looks like this was merged without a test passing. These checks had not passed on eb5131a when it was merged:
Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 9.5.10-0 🚀
|
|
No help site update needed. This PR only adds null checks so a bad workspace member entry no longer crashes the Workspaces tab, and nothing users see or any article describes has changed. |
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 9.5.12-0 🚀
|
|
No help site update needed. This PR only adds null checks so a bad workspace member entry no longer crashes the Workspaces tab, and nothing users see or any article describes has changed. |
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.12-1 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
Follow-up to Show workflows whose approver left the workspace, and stop creating them. That PR added a red-dot check that the Workspaces tab button runs on every page, for every workspace. The check builds each workspace's approval workflows, and the builders destructure each
employeeListentry with no null check. ThePolicyEmployeetype rules outnull, but anullentry does reach the client at runtime. Onenullentry in any workspace crashedNavigationTabBar_WorkspacesTabButton.This PR skips
nullentries everywhere the red-dot path readsemployeeList:convertPolicyEmployeesToApprovalWorkflowsandconvertApprovalWorkflowRulesToWorkflowsskip anullemployee before destructuring it (WorkflowUtils.ts:237,WorkflowUtils.ts:1671).hasApprovalWorkflowWithNonMemberApproverreadssubmitsTo,forwardsTo, andoverLimitForwardsTooptionally (WorkflowUtils.ts:1860).A new unit test covers both the beta and non-beta paths. Before the fix, it fails with the same
TypeErrors (Cannot destructure property 'email' of 'employee' as it is nullandCannot read properties of null (reading 'submitsTo')). After the fix, it passes and still flags the workspace's broken workflow.Investigation: #102815 (comment)
Fixed Issues
$ #102234
PROPOSAL: #102815 (comment)
Tests
Offline tests
N/A
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari